package com.wasu.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import com.wasu.jopo.User;

@Service
public class UserService {
	
	@Autowired
	private RestTemplate restTemplate;
	
	public User findUserById(Integer id) {
		String ServreId = "userServer";
		User user = restTemplate.getForObject("http://" + ServreId + "/findUserById/" + id, User.class);
		return user;
	}
	
}
